#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int i, r, j;
	double eps, sum;
	scanf("%d", &r);
	for (i = 0; i < r; i++) {
		scanf("%lf", &eps);
		sum = 0; j = 1;
		while ((1.0 / (2 * j - 1)) >= eps) {
			if ((j + 1) % 2 == 0) sum = sum + (1.0 / (2 * j - 1));
			else if ((j + 1) % 2 != 0) sum = sum - (1.0 / (2 * j - 1));
			j = j + 1;//j=1,对应n=1 
		}
		printf("%.6f\n", sum);
	}
	return 0;
}//1079 正确